<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model model-name="tanks" description="Модель &quot;Резервуары&quot; для примера Нефтебаза" version="0.0.21">
  <enum name="TankOperKind">
    <value name="CHEKING"/>
    <value name="INPUT" label="Наполнение"/>
    <value name="OUTPUT"/>
  </enum>
  <class name="Coordinates" is-abstract="false" is-dictionary="false" embeddable="true">
    <property name="latitude" type="STRING" length="254" mask="^(\\+|-)?(?:90(?:(?:\\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\\.[0-9]{1,6})?))$"/>
    <property name="longitude" type="STRING" label="^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$" length="254"/>
  </class>
  <class name="Measure" is-abstract="false" is-dictionary="true" embeddable="false">
    <property name="description" type="STRING" length="254"/>
    <property name="name" type="STRING" length="254"/>
  </class>
  <class name="Tank" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <id category="MANUAL"/>
    <property name="currentVal" type="BIGDECIMAL" length="38" scale="10" default-value="0">
      <historical>true</historical>
    </property>
    <property name="location" type="Coordinates"/>
    <property name="rawData" type="TEXT"/>
    <property name="tankDateList" type="TankDate" collection="SET" mappedBy="tank"/>
    <property name="tankOpenDate" type="LOCALDATE">
      <historical>true</historical>
    </property>
    <property name="tankOperationList" type="TankOperation" collection="SET" mappedBy="tank"/>
    <property name="tankType" type="TankType" mandatory="true"/>
    <reference name="owner" type="Customer"/>
    <index unique="true">
      <property name="currentVal"/>
      <property name="location"/>
    </index>
  </class>
  <class name="TankDate" is-abstract="false" embeddable="false" strategy="JOINED">
    <property name="fieldData" type="STRING" length="254"/>
    <property name="fieldName" type="STRING" length="254"/>
    <property name="rawData" type="TEXT"/>
    <property name="tank" type="Tank" parent="true"/>
    <index unique="false">
      <property name="fieldName"/>
      <property name="fieldData"/>
    </index>
  </class>
  <class name="TankOperation" is-abstract="false" is-dictionary="false" embeddable="false" strategy="JOINED">
    <property name="kind" type="TankOperKind"/>
    <property name="operDateTimeUtc" type="OFFSETDATETIME" length="3" default-value="now"/>
    <property name="tank" type="Tank" parent="true"/>
    <property name="val" type="BIGDECIMAL" length="38" scale="10"/>
    <reference name="customer" type="Customer"/>
    <reference name="transfer" type="Transfer" label=""/>
  </class>
  <class name="TankType" is-abstract="false" is-dictionary="true" embeddable="false">
    <property name="description" type="STRING" length="254"/>
    <property name="maxVal" type="BIGDECIMAL" length="38" scale="10"/>
    <property name="measure" type="Measure" parent="false"/>
    <property name="minVal" type="BIGDECIMAL" length="38" scale="10"/>
    <property name="name" type="STRING" length="254"/>
  </class>
  <status-classes class="TankOperation">
    <stakeholder code="O" name="Оператор"/>
  </status-classes>
  <statuses class="TankOperation" historical="true">
    <stakeholder-link code="O">
      <status code="CANCELED" name="Заявка отменена заказчиком" initial="false"/>
      <status code="COMPLETED" name="Заявка выполнена" initial="false"/>
      <status code="CONFIRMED" name="Заявка подтверждена" initial="false">
        <to status="CANCELED"/>
        <to status="COMPLETED"/>
        <to status="statusCode"/>
      </status>
      <status code="DECLINED" name="Заявка отменена нефтебазой" initial="false"/>
      <status code="NEW" name="Новая заявка" initial="true">
        <to status="CANCELED"/>
        <to status="CONFIRMED"/>
        <to status="DECLINED"/>
      </status>
      <status code="statusCode" name="Описание статуса" initial="false"/>
    </stakeholder-link>
  </statuses>
  <layout>
    <model x="0" y="0"/>
    <enums>
      <enum name="TankOperKind">
        <value name="CHEKING" x="1514" y="1637"/>
        <value name="INPUT" x="1514" y="1517"/>
        <value name="OUTPUT" x="1514" y="1577"/>
      </enum>
    </enums>
    <classes>
      <class name="Coordinates">
        <property name="latitude" x="1016" y="420"/>
        <property name="longitude" x="1016" y="480"/>
      </class>
      <class name="Measure">
        <property name="description" x="1415" y="1164"/>
        <property name="name" x="1415" y="1104"/>
      </class>
      <class name="TankType">
        <property name="description" x="1415" y="771"/>
        <property name="maxVal" x="1415" y="651"/>
        <property name="measure" x="1415" y="831"/>
        <property name="minVal" x="1415" y="591"/>
        <property name="name" x="1415" y="711"/>
      </class>
      <class name="Tank">
        <property name="location" x="310" y="637"/>
        <property name="tankType" x="310" y="757"/>
        <property name="tankOperationList" x="310" y="1057"/>
        <property name="currentVal" x="310" y="817"/>
        <property name="tankOpenDate" x="310" y="697"/>
        <property name="rawData" x="310" y="577"/>
        <property name="tankDateList" x="310" y="997"/>
        <reference name="owner" x="310" y="877"/>
      </class>
      <class name="TankOperation">
        <property name="val" x="748" y="1236"/>
        <property name="kind" x="748" y="1296"/>
        <property name="operDateTimeUtc" x="748" y="1176"/>
        <property name="tank" x="748" y="1116"/>
        <reference name="transfer" x="748" y="1416"/>
        <reference name="customer" x="748" y="1356"/>
      </class>
      <class name="TankDate">
        <property name="tank" x="-176" y="1072"/>
        <property name="rawData" x="-176" y="1132"/>
        <property name="fieldName" x="-176" y="1192"/>
        <property name="fieldData" x="-176" y="1252"/>
      </class>
    </classes>
  </layout>
</model>
